﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage.Master" CodeBehind="SearchResults.aspx.vb" Inherits="RUHResturants.SearchResults" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\RUHRestaurantsDB.accdb;Persist Security Info=True" 
    ProviderName="System.Data.OleDb" 
    
    
        SelectCommand="SELECT [RestName], [PriceLevel], [Telephone], [LuxuryLevel], [WorkingHours], [Resturants.Id] AS column1 FROM [ResturantsDetails] WHERE ([RestName] LIKE '%' + ? + '%')">
    <SelectParameters>
        <asp:SessionParameter Name="RestName" SessionField="Search" Type="String" />
    </SelectParameters>
</asp:SqlDataSource>
    <asp:Label ID="Label1" runat="server"></asp:Label>
    <asp:GridView ID="GridView1" runat="server" 
        
    EmptyDataText="Sorry but no associated database records related to your query" 
    AllowPaging="True" AutoGenerateColumns="False" CellPadding="4" 
    DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <Columns>
            <asp:BoundField DataField="RestName" HeaderText="Restaurant Name" 
                SortExpression="RestName" />
            <asp:BoundField DataField="PriceLevel" HeaderText="Price Level" 
                SortExpression="PriceLevel" />
            <asp:BoundField DataField="Telephone" HeaderText="Telephone" 
                SortExpression="Telephone" />
            <asp:BoundField DataField="LuxuryLevel" HeaderText="Luxury Level" 
                SortExpression="LuxuryLevel" />
            <asp:BoundField DataField="WorkingHours" HeaderText="Working Hours" 
                SortExpression="WorkingHours" />
 
            <asp:TemplateField ShowHeader="False">
             <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("column1", "Details.aspx?Id={0}") %>' 
                        Text="Details"></asp:HyperLink>
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
</asp:Content>
 
